<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<p>BlokingQueue</p>
 			Throws Exception 		Special Value 		Blocks 		Times Out
Insert 		add(o) 					offer(o) 			put(o) 		offer(o, timeout, timeunit)
Remove 		remove(o) 				poll(o) 			take(o) 	poll(timeout, timeunit)
Examine 	element(o) 				peek(o)

    Throws Exception:
    If the attempted operation is not possible immediately, an exception is thrown.
    Special Value:
    If the attempted operation is not possible immediately, a special value is returned (often true / false).
    Blocks:
    If the attempted operation is not possible immedidately, the method call blocks until it is.
    Times Out:
    If the attempted operation is not possible immedidately, the method call blocks until it is, but waits no longer than the given timeout. Returns a special value telling whether the operation succeeded or not (typically true / false).

-	BlockingQueue la interface => cac lop implement no
    ArrayBlockingQueue: FIFO, gioi han so phan tu luc khoi tao va sau do ko the thay doi, luu tru theo kieu array
    DelayQueue: moi phan tu ton tai trong 1 khoang thoi gian xac dinh, neu khoang thoi gian am or =0 thi se bi lay o lan take tiep theo
    LinkedBlockingQueue: luu tru theo kieu linklist, FIFO. co the chi ro gioi han so phan tu luc khoi tao, neu ko chi ra thi gioi han = Integer.MAX_VALUE
    PriorityBlockingQueue: thu tu sap xep cac phan tu luc lay ra duoc dam bao (peek, poll), nhung neu dung iterator duyet thi ko dam bao theo thu tu
    SynchronousQueue: 1 luong chen phan tu vao se bi blocked cho den khi luong khac lay phan tu ra, luong lay phan tu ra neu queue ko co phan tu se cho cho den khi luong khac chen phan tu vao
<p>PriorytiQueue</p>

<p>BlockingDeque extends BlockingQueue, Deque</p>
khac voi queue la co the chen, lay phan tu o ca 2 dau cua queue
=> tuong ung nhu vay cung phai co cac phan tu dap ung nhu vay


  			Throws Exception 		Special Value 		Blocks 			Times Out
Insert 		addFirst(o) 			offerFirst(o) 		putFirst(o) 	offerFirst(o, timeout, timeunit)
Remove 		removeFirst(o) 			pollFirst(o) 		takeFirst(o) 	pollFirst(timeout, timeunit)
Examine 	getFirst(o) 			peekFirst(o)

 			Throws Exception 	Special Value 	Blocks 			Times Out
Insert 		addLast(o) 			offerLast(o) 	putLast(o) 		offerLast(o, timeout, timeunit)
Remove 		removeLast(o) 		pollLast(o) 	takeLast(o) 	pollLast(timeout, timeunit)
Examine 	getLast(o) 			peekLast(o)

=> co the dung BlockingDeque nhu BlockingQueue
BlockingQueue		BlockingDeque
add() 				addLast()
offer() x 2			offerLast() x 2
put() 				putLast()

remove() 			removeFirst()
poll() x 2 			pollFirst()
take() 				takeFirst()

element() 			getFirst()
peek() 				peekFirst()
</body>
</html>